<template>
	<view>
		<scroll-view class="quanbox" scroll-y>
			<view class="quan" v-for="(item,index) in couponList">
				<view class="dpimgbox">
					<image src="../../../static/enterprise/item.png" mode="aspectFill"></image>
				</view>
				<view class="dpnamecon">
					<view class="bbbb">
						<view class="ddnn">{{item.couponName}}</view>
						<view class="man" v-if="item.couponType==0">
							<view class="jian">￥{{item.couponMoney}}</view>
							<view class="mmmm">满￥{{item.couponThreshold}}可用</view>
							
						</view>
						<view class="man" v-if="item.couponType==1">
							<view class="jian">{{item.discount}}%</view>
							<view class="mmmm">折扣券</view>
						</view>
						<view class="time">
							{{$u.timeFormat(item.endTime, "yyyy-mm-dd hh:MM:ss")}}
						</view>
					</view>
					<view class="btn" v-if="item.couponStatus==0">未使用</view>
					<view class="btn" v-if="item.couponStatus==1">已使用</view>
				</view>
				<view class="top"></view>
				<view class="bottom"></view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import {selectUserCoupon} from "../../../api/product.js"
	export default{
		data(){
			return{
				couponList:[],
				pageNum:1
			}
		},
		onLoad() {
			this.getCouponList()
		},
		methods:{
			getCouponList(){
				this.get(selectUserCoupon,{pageNum:this.pageNum,pageSize:10}).then(res=>{
					this.pageNum++
					console.log(res)
					this.couponList=res.data
				})
			}
		}
	}
</script>

<style lang="less">
	.quanbox {
		padding: 30rpx 55rpx;
		// max-height: 750rpx;
	}
		
	.time{
		font-size: 24rpx;
		color: #ED712F;
	}
	.quan {
		height: 150rpx;
		width: 640rpx;
		background-color: #FDECE0;
		border-radius: 20rpx;
		overflow: hidden;
		position: relative;
		display: flex;
		align-items: center;
		margin-top: 20rpx;
	}

	.dpimgbox {
		width: 171rpx;
		height: 150rpx;
		border-right: 1px #FF0000 dashed;
		padding-left: 30rpx;
		display: flex;
		align-items: center;

		image {
			width: 100rpx;
			height: 100rpx;
			border-radius: 100rpx;
		}
	}

	.dpnamecon {
		display: flex;
		align-items: center;
		width: 450rpx;
		justify-content: space-between;
		padding-left: 40rpx;
		box-sizing: border-box;
	}

	.bbbb {
		height: 150rpx;
		padding-top: 20rpx;
	}

	.ccc {
		background: #999999 !important;
		opacity: 0.5;
	}

	.ddnn {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: bold;
		line-height: 42rpx;
		color: #ED712F;
		opacity: 1;
	}

	.mmmm {
		height: 28rpx;
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: bold;
		line-height: 28rpx;
		color: #EC5F2A;
		opacity: 1;
	}

	.jian {
		color: #ED712F;
		font-size: 28rpx;
		margin-right: 20rpx;
	}

	.btn {
		width: 140rpx;
		height: 50rpx;
		background: linear-gradient(180deg, #F09238 0%, #EC5F2A 100%);
		opacity: 1;
		border-radius: 30rpx;
		color: #FFFFFF;
		font-size: 26rpx;
		text-align: center;
		line-height: 50rpx;
	}
	
	.man {
		display: flex;
		align-items: center;
		margin-top: 10rpx;
	}
	.top {
		width: 40rpx;
		height: 40rpx;
		background-color: #FFFFFF;
		left: 150rpx;
		top: -20rpx;
		position: absolute;
		border-radius: 40rpx;
	}
	
	.bottom {
		width: 40rpx;
		height: 40rpx;
		background-color: #FFFFFF;
		left: 150rpx;
		top: 130rpx;
		position: absolute;
		border-radius: 40rpx;
	}
</style>
